#include "widget.h"
#include "ui_widget.h"

#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_Up_clicked()
{
    QRect rect = ui->pushButton_target->geometry();
    ui->pushButton_target->setGeometry(rect.x(), rect.y()-5, rect.width(), rect.height());
//    rect.setY(rect.y()-5);
//    ui->pushButton_target->setGeometry(rect);
}

void Widget::on_pushButton_Down_clicked()
{
    QRect rect = ui->pushButton_target->geometry();
    ui->pushButton_target->setGeometry(rect.x(), rect.y()+5, rect.width(), rect.height());
//    rect.setY(rect.y()+5);
//    ui->pushButton_target->setGeometry(rect);
}

void Widget::on_pushButton_Left_clicked()
{
    QRect rect = ui->pushButton_target->geometry();
    ui->pushButton_target->setGeometry(rect.x()-5, rect.y(), rect.width(), rect.height());
//    rect.setX(rect.x()-5);
//    ui->pushButton_target->setGeometry(rect);
}

void Widget::on_pushButton_Right_clicked()
{
    QRect rect = ui->pushButton_target->geometry();
    ui->pushButton_target->setGeometry(rect.x()+5, rect.y(), rect.width(), rect.height());
//    rect.setX(rect.x()+5);
//    ui->pushButton_target->setGeometry(rect);
}
